# eric7.DataViews.PyProfileDialog

Module implementing a dialog to display profile data.

### Global Attributes

None

### Classes

ProfileTreeWidgetItem | Class implementing a custom QTreeWidgetItem to allow sorting on numeric values.
PyProfileDialog | Class implementing a dialog to display the results of a profiling run.

### Functions

None

## ProfileTreeWidgetItem

Class implementing a custom QTreeWidgetItem to allow sorting on numeric values.

### Derived from

QTreeWidgetItem

### Class Attributes

None

### Class Methods

None

### Methods

__getNC | Private method to get the value to compare on for the first column.
__lt__ | Special method to check, if the item is less than the other one.

### Static Methods

None

#### ProfileTreeWidgetItem.__getNC

__getNC(itm)

Private method to get the value to compare on for the first column.

itm (ProfileTreeWidgetItem)
  item to operate on

Return:
  comparison value for the first column

Return Type:
  int

#### ProfileTreeWidgetItem.__lt__

__lt__(other)

Special method to check, if the item is less than the other one.

other (ProfileTreeWidgetItem)
  reference to item to compare against

Return:
  true, if this item is less than other

Return Type:
  bool

Up

## PyProfileDialog

Class implementing a dialog to display the results of a profiling run.

### Derived from

QDialog, Ui_PyProfileDialog

### Class Attributes

None

### Class Methods

None

### Methods

PyProfileDialog | Constructor
__createResultItem | Private method to create an entry in the result list.
__createSummaryItem | Private method to create an entry in the summary list.
__eraseAll | Private slot to handle the Erase All context menu action.
__eraseProfile | Private slot to handle the Erase Profile context menu action.
__eraseTiming | Private slot to handle the Erase Timing context menu action.
__filter | Private slot to handle the Exclude/Include Python Library context menu action.
__finish | Private slot called when the action finished or the user pressed the button.
__populateLists | Private method used to populate the listviews.
__resortResultList | Private method to resort the tree.
__showContextMenu | Private slot to show the context menu of the listview.
__unfinish | Private slot called to revert the effects of the __finish slot.
closeEvent | Protected method to handle the close event.
on_buttonBox_clicked | Private slot called by a button of the button box clicked.
start | Public slot to start the calculation of the profile data.

### Static Methods

None

#### PyProfileDialog (Constructor)

PyProfileDialog(parent=None)

Constructor

parent (QWidget)
  parent widget

#### PyProfileDialog.__createResultItem

__createResultItem(calls, totalTime, totalTimePerCall, cumulativeTime, cumulativeTimePerCall, file, line, functionName, )

Private method to create an entry in the result list.

calls (int)
  number of calls
totalTime (float)
  total time
totalTimePerCall (float)
  total time per call
cumulativeTime (float)
  cumulative time
cumulativeTimePerCall (float)
  cumulative time per call
file (str)
  filename of file
line (int)
  linenumber
functionName (str)
  function name

#### PyProfileDialog.__createSummaryItem

__createSummaryItem(label, contents)

Private method to create an entry in the summary list.

label (str)
  text of the first column
contents (str)
  text of the second column

#### PyProfileDialog.__eraseAll

__eraseAll()

Private slot to handle the Erase All context menu action.

#### PyProfileDialog.__eraseProfile

__eraseProfile()

Private slot to handle the Erase Profile context menu action.

#### PyProfileDialog.__eraseTiming

__eraseTiming()

Private slot to handle the Erase Timing context menu action.

#### PyProfileDialog.__filter

__filter()

Private slot to handle the Exclude/Include Python Library context menu action.

#### PyProfileDialog.__finish

__finish()

Private slot called when the action finished or the user pressed the button.

#### PyProfileDialog.__populateLists

__populateLists(exclude=False)

Private method used to populate the listviews.

exclude (bool)
  flag indicating whether files residing in the Python library should be excluded

#### PyProfileDialog.__resortResultList

__resortResultList()

Private method to resort the tree.

#### PyProfileDialog.__showContextMenu

__showContextMenu(coord)

Private slot to show the context menu of the listview.

coord (QPoint)
  the position of the mouse pointer

#### PyProfileDialog.__unfinish

__unfinish()

Private slot called to revert the effects of the __finish slot.

#### PyProfileDialog.closeEvent

closeEvent(_evt)

Protected method to handle the close event.

_evt (QCloseEvent)
  reference to the close event (unused)

#### PyProfileDialog.on_buttonBox_clicked

on_buttonBox_clicked(button)

Private slot called by a button of the button box clicked.

button (QAbstractButton)
  button that was clicked

#### PyProfileDialog.start

start(pfn, fn=None)

Public slot to start the calculation of the profile data.

pfn (str)
  basename of the profiling file
fn (str)
  file to display the profiling data for

Up